package com.lyun.controller;

import com.lyun.common.R;
import com.lyun.dto.AdminAuditSmallVideoDTO;
import com.lyun.dto.AdminSmallVideoDTO;
import com.lyun.service.SmallVideoService;
import com.lyun.vo.AdminSmallVideoVO;
import com.lyun.vo.PageVO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/admin/smallvideo")
@CrossOrigin
public class AdminSmallVideoController {

    @DubboReference
    private SmallVideoService smallVideoService;

    /**
     * 管理端-获取小视频列表
     *
     * @return
     */
    @GetMapping("/getAll")
    public R<PageVO<AdminSmallVideoVO>> adminGetAll(AdminSmallVideoDTO dto) {
        return R.success(smallVideoService.adminGetAll(dto));
    }

    /**
     * 管理端-审核小视频
     *
     * @return
     */
    @GetMapping("/audit")
    public R<String> adminAuditVideo(AdminAuditSmallVideoDTO dto) {
        smallVideoService.auditSmallVideo(dto);
        return R.success("操作成功");
    }

}
